/* 
 * Selling Partner API for FBA Inbound Eligibilty
 *
 * With the FBA Inbound Eligibility API, you can build applications that let sellers get eligibility previews for items before shipping them to Amazon's fulfillment centers. With this API you can find out if an item is eligible for inbound shipment to Amazon's fulfillment centers in a specific marketplace. You can also find out if an item is eligible for using the manufacturer barcode for FBA inventory tracking. Sellers can use this information to inform their decisions about which items to ship Amazon's fulfillment centers.
 *
 * OpenAPI spec version: v1
 * 
 * Generated by: https://github.com/swagger-api/swagger-codegen.git
 */

using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
using System.Text;

namespace FikaAmazonAPI.AmazonSpApiSDK.Models.FbaInbound
{
    /// <summary>
    /// The response schema for the getItemEligibilityPreview operation.
    /// </summary>
    [DataContract]
    public partial class GetItemEligibilityPreviewResponse : IEquatable<GetItemEligibilityPreviewResponse>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="GetItemEligibilityPreviewResponse" /> class.
        /// </summary>
        /// <param name="Payload">The payload for the getItemEligibilityPreview operation..</param>
        /// <param name="Errors">An unexpected condition occurred during the GetItemEligibilityPreview operation..</param>
        public GetItemEligibilityPreviewResponse(ItemEligibilityPreview Payload = default(ItemEligibilityPreview), ErrorList Errors = default(ErrorList))
        {
            this.Payload = Payload;
            this.Errors = Errors;
        }
        public GetItemEligibilityPreviewResponse()
        {
            this.Payload = default(ItemEligibilityPreview);
            this.Errors = default(ErrorList);
        }
        /// <summary>
        /// The payload for the getItemEligibilityPreview operation.
        /// </summary>
        /// <value>The payload for the getItemEligibilityPreview operation.</value>
        [DataMember(Name = "payload", EmitDefaultValue = false)]
        public ItemEligibilityPreview Payload { get; set; }

        /// <summary>
        /// An unexpected condition occurred during the GetItemEligibilityPreview operation.
        /// </summary>
        /// <value>An unexpected condition occurred during the GetItemEligibilityPreview operation.</value>
        [DataMember(Name = "errors", EmitDefaultValue = false)]
        public ErrorList Errors { get; set; }

        /// <summary>
        /// Returns the string presentation of the object
        /// </summary>
        /// <returns>String presentation of the object</returns>
        public override string ToString()
        {
            var sb = new StringBuilder();
            sb.Append("class GetItemEligibilityPreviewResponse {\n");
            sb.Append("  Payload: ").Append(Payload).Append("\n");
            sb.Append("  Errors: ").Append(Errors).Append("\n");
            sb.Append("}\n");
            return sb.ToString();
        }

        /// <summary>
        /// Returns the JSON string presentation of the object
        /// </summary>
        /// <returns>JSON string presentation of the object</returns>
        public string ToJson()
        {
            return JsonConvert.SerializeObject(this, Formatting.Indented);
        }

        /// <summary>
        /// Returns true if objects are equal
        /// </summary>
        /// <param name="input">Object to be compared</param>
        /// <returns>Boolean</returns>
        public override bool Equals(object input)
        {
            return this.Equals(input as GetItemEligibilityPreviewResponse);
        }

        /// <summary>
        /// Returns true if GetItemEligibilityPreviewResponse instances are equal
        /// </summary>
        /// <param name="input">Instance of GetItemEligibilityPreviewResponse to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(GetItemEligibilityPreviewResponse input)
        {
            if (input == null)
                return false;

            return
                (
                    this.Payload == input.Payload ||
                    (this.Payload != null &&
                    this.Payload.Equals(input.Payload))
                ) &&
                (
                    this.Errors == input.Errors ||
                    (this.Errors != null &&
                    this.Errors.Equals(input.Errors))
                );
        }

        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;
                if (this.Payload != null)
                    hashCode = hashCode * 59 + this.Payload.GetHashCode();
                if (this.Errors != null)
                    hashCode = hashCode * 59 + this.Errors.GetHashCode();
                return hashCode;
            }
        }

        /// <summary>
        /// To validate all properties of the instance
        /// </summary>
        /// <param name="validationContext">Validation context</param>
        /// <returns>Validation Result</returns>
        IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
        {
            yield break;
        }
    }

}
